import java.util.List;
import java.util.Objects;

/**
 * 封装一个自定义的文件对象
 * @ClassName: MyFile
 * @author: zyx
 * @E-mail: 1377631190@qq.com
 * @DATE: 2020/2/1 15:04
 */
public class MyFile {

    private String fileName;

    private List<String> contents;

    private String absolutePath;

    public MyFile() {
    }

    public MyFile(String fileName, List<String> contents, String absolutePath) {
        this.fileName = fileName;
        this.contents = contents;
        this.absolutePath = absolutePath;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public List<String> getContents() {
        return contents;
    }

    public void setContents(List<String> contents) {
        this.contents = contents;
    }

    public String getAbsolutePath() {
        return absolutePath;
    }

    public void setAbsolutePath(String absolutePath) {
        this.absolutePath = absolutePath;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MyFile myFile = (MyFile) o;
        return Objects.equals(fileName, myFile.fileName) &&
                Objects.equals(contents, myFile.contents) &&
                Objects.equals(absolutePath, myFile.absolutePath);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fileName, contents, absolutePath);
    }

    @Override
    public String toString() {
        return "MyFile{" +
                "fileName='" + fileName + '\'' +
                ", contents=" + contents +
                ", absolutePath='" + absolutePath + '\'' +
                '}';
    }
}
